﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	x:Class="nRoute.Samples.SimpleMVVM.MainPage"
    mc:Ignorable="d"
    xmlns:nControls="clr-namespace:nRoute.Controls;assembly=nRoute.Framework" 
	xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
	xmlns:nBehaviors="clr-namespace:nRoute.Behaviors;assembly=nRoute.Framework" 
    d:DesignHeight="600" d:DesignWidth="800">
	<i:Interaction.Behaviors>
		<nBehaviors:BridgeViewModelBehavior/>
	</i:Interaction.Behaviors>

    <Grid x:Name="LayoutRoot">

    	<Grid.Background>
    		<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    			<GradientStop Color="Black" Offset="0"/>
    			<GradientStop Color="White" Offset="1"/>
    		</LinearGradientBrush>
    	</Grid.Background>
    	<Grid.RowDefinitions>
    		<RowDefinition Height="54"/>
    		<RowDefinition/>
    	</Grid.RowDefinitions>
    	<nControls:StatefulContainer Grid.Row="1" Url="Pages/PageA">
    		<i:Interaction.Behaviors>
    			<nBehaviors:NavigationHandlerBehavior IsDefaultHandler="True"/>
    			<nBehaviors:NavigationShellIntegrationBehavior />
    		</i:Interaction.Behaviors>
    	</nControls:StatefulContainer>
		
		<ItemsControl ItemsSource="{Binding SiteMapNodes}">
			<ItemsControl.ItemsPanel>
				<ItemsPanelTemplate>
					<StackPanel Orientation="Horizontal"/>
				</ItemsPanelTemplate>
			</ItemsControl.ItemsPanel>
			<ItemsControl.ItemTemplate>
				<DataTemplate>
					<Button MinWidth="100" Content="{Binding Title}" BorderThickness="1" Margin="10,0" Height="30">
		    			<i:Interaction.Triggers>
		    				<i:EventTrigger EventName="Click">
    							<nBehaviors:ExecuteSiteMapNodeAction SiteMapNode="{Binding}"/>
		    				</i:EventTrigger>
		    			</i:Interaction.Triggers>
		    		</Button>
				</DataTemplate>
			</ItemsControl.ItemTemplate>
		</ItemsControl>

    </Grid>
</UserControl>
